/** Copyright 2013-2023 步步高商城. */
package com.taobao.diamond.manager;

import org.apache.commons.lang.StringUtils;

/**
 * 
 * @author <a href="mailto:takeseem@gmail.com">杨浩</a>
 * @since 0.1.0
 */
public abstract class SkipInitialCallbackListener implements ManagerListener {

	private final String initialValue;
	private boolean hasCallbacked = false;

	public SkipInitialCallbackListener(String initialConfig) {
		this.initialValue = initialConfig;
	}

	@Override
    public void receiveConfigInfo(String configInfo) {
		if (!this.hasCallbacked) {
			this.hasCallbacked = true;
			if (StringUtils.equals(this.initialValue, configInfo)) {
				return;
			}
		}
		receiveConfigInfo0(configInfo);
	}

	public abstract void receiveConfigInfo0(String paramString);
}